package File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Demo8 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("./test.txt")){
            // 97 在 ASCII 码表中就是 'a'
            // outputStream.write(97);
            // outputStream.write(98);
            // outputStream.write(99);

            byte[] bytes = {97,98,99};
            outputStream.write(bytes);


        } catch (IOException e) {
            // 此处需要处理两个异常,但是由于对于异常的处理情况是一样的,所以合并处理了
            throw new RuntimeException(e);
        }
    }
}
